package com.blb.utils;

import lombok.Data;

@Data
public class Response {

    private boolean rs = true;
    private String msg = "操作成功";
    private Object data;

    public Response() {
    }

    public Response(String msg) {
        this.msg = msg;
    }

    public Response(boolean rs, String msg) {
        this.rs = rs;
        this.msg = msg;
    }

    public Response(boolean rs, String msg, Object data) {
        this.rs = rs;
        this.msg = msg;
        this.data = data;
    }

    public static Response success(){
        Response response = new Response();
        response.setRs(true);
        return  response;
    }

    public static Response success(String msg){
        return new Response(msg);
    }

    public static Response error(String msg){
        Response response = new Response(msg);
        response.setRs(false);
        return response;
    }
}
